React Native
Table of Contentsβ
2025β
React Native Isn't as Popular as You Thinkβ
| Node.js Version | LTS Status | React Native Version Compatibility | Notes |
|---|---|---|---|
| 20.13.1 | Active LTS | 0.73.x and above | Supports the latest React Native features; recommended for new projects. |
| --- | --- | --- | --- |
Key Pointsβ
- Node.js 20.13.1 (Active LTS since April 2024, supported until April 2026) is compatible with React Native 0.73.x and later releases. The latest React Native version as of mid-2025 is around 0.74.x (based on the typical biannual release cycle), which aligns with Node.js 20.x.
- Earlier React Native versions (e.g., 0.68.x to 0.72.x) support Node.js 14.x to 18.x, but since 18.x is now in maintenance LTS (ending active support April 2025), it's less ideal for new development.
MacOS Sonoma Install Stepsβ
brew install openJDK@17
environment varβ
set JAVA_HOME
brew installβ
brew install ios-deploy
https://shift.infinite.red/react-native-10-years-db9eb36c5af6
Upgradeβ
https://react-native-community.github.io/upgrade-helper/
Animationsβ
- reactnativereanimated
- https://moti.fyi
Introβ
VIDEO: After Trying React Native, I'll Never Use Anything Else
September 2024β
https://www.youtube.com/watch?v=msErROjFY08
Tutorialsβ
Verify Installedβ
npx react-native doctor
UI Librariesβ
- https://reactnativeelements.com
- nativewind.dev
- unistyl.es
- https://nativebase.io/

https://jscomplete.com/learn/javascript-for-react
Errorsβ
react-native doctor

Unable to run simctl: Error: xcrun simctl help exited with non-zero code: 72
Accessing Native Code in Modulesβ
- Accessing Platform specific code using Native modules in react native
- Leverage native APIs for deeper integrations with iOS/Android platforms
JSXβ
- Readability
- All the code for the page in a single file
Reduxβ
- Stateful Component
- Stateless Component
Thunk allows to write an action creators that return a function instead of the typical action object. Where as redux-saga is a library that mainly focuses on easy handling of application side effects and more efficient for execution
step-by-step process of Redux-Thunkβ
Check what the incoming action is: If it is a regular action object, Redux-Thunk does not do anything and the action object is processed by the storeβs reducer A thunk creator, which is an action creator that returns a thunk (a.k.a. asynchronous action creators)
2.The thunk itself, which is the function that is returned from the thunk creator and accepts dispatch and setState as arguments If the action is a function, Redux-Thunk invokes it and passes it the storeβs dispatch and getState methods and any extra arguments (e.g., axios) 3. After the function runs, the thunk then dispatches the action, which will then update the state accordingly
Redux-Saga is a library that aims to make application side effects (e.g., asynchronous actions such as fetching data) easier to handle and more efficient to execute. The idea is that a saga is similar to a separate thread in your application thatβs solely responsible for side effects.
The benefit to Redux-Saga in comparison to Redux-Thunk is that you can avoid callback hell meaning that you can avoid passing in functions and calling them inside. Additionally, you can more easily test your asynchronous data flow. The call and put methods return JavaScript objects. Thus, you can simply test each value yielded by your saga function with an equality comparison. On the other hand, Redux-Thunk returns promises, which are more difficult to test. Testing thunks often requires complex mocking of the fetch api, axios requests, or other functions. With Redux-Saga, you do not need to mock functions wrapped with effects. This makes tests clean, readable and easier to write. Redux-Thunk, however is great for small use cases and for beginners. The thunksβ logic is all contained inside of the function. Additionally, you do not need to learn a new function type, generators, and the keywords and methods associated with this function type. In conclusion, there are tradeoffs for each middleware and depending on your project, you can decide which middleware is most fitting for your code.
Global Store | Keep track of changes to the tree
higher-order component (HOC) A higher-order component (HOC) is an advanced technique in React for reusing component logic. HOCs are not part of the React API, per se. They are a pattern that emerges from Reactβs compositional nature.
touchable componentsβ
React Native provides several components that respond to touches in a way that is consistent with the native behavior. These touchable components include:
-
TouchableHighlight: When pressed, it dims the button and fires an event. This is best used for buttons or links that need to visually respond to being touched. -
TouchableOpacity: This component makes the view slightly transparent when touched. It's less visually intrusive thanTouchableHighlightand is often used for icons or to wrap custom components. -
TouchableWithoutFeedback: As the name suggests, this component allows you to handle touch events without any feedback on the UI. It's useful when you need to capture a press action on a component without changing its appearance. -
TouchableNativeFeedback: This component provides touch feedback for Android in the form of a ripple effect that originates from the point of touch. It's Android-specific and helps maintain the Material Design look and feel. -
Pressable: Introduced in React Native 0.63,Pressableis a core component that can detect various stages of press interactions. It is more flexible than the other touchable components and can be customized to fit a wide variety of use cases.Pressablecan be used to detect simple presses, long presses, and even more complex gestures if needed.
Each of these components has its own set of props that can be used to customize its behavior, such as onPress, onLongPress, underlayColor for TouchableHighlight, activeOpacity for TouchableOpacity, and so on. Choosing the right touchable component depends on the specific needs of your application and the visual feedback you want to provide to your users.
Common Issues with DOM Event Methods in React Nativeβ
AnimationEventβ
Issue: Animations not triggering or behaving unexpectedly.
Solution: Ensure that the animation library (e.g., react-native-reanimated) is properly installed and configured. Verify that the animation methods are correctly implemented and that the components are properly wrapped with animation containers.
KeyboardEventβ
Issue: Keyboard not dismissing or causing layout issues.
Solution: Use Keyboard.dismiss() to programmatically dismiss the keyboard. Ensure that the KeyboardAvoidingView component is used to handle keyboard interactions and prevent layout issues.
InputEventβ
Issue: Input fields not responding to user input or losing focus.
Solution: Ensure that the TextInput component is correctly implemented with proper props such as onChangeText and value. Verify that the input fields are not being unmounted or losing focus due to re-renders.
MouseEventβ
Issue: Mouse events not working as expected on web versions of React Native apps.
Solution: Use the react-native-web library to ensure compatibility with web-specific mouse events. Verify that the event handlers such as onMouseEnter, onMouseLeave, and onClick are correctly implemented.
isTrustedβ
Issue: Events not being recognized as trusted, leading to unexpected behavior.
Solution: Ensure that events are being dispatched correctly and that they originate from user interactions. Avoid manually dispatching events unless necessary, and ensure that the event properties are correctly set.
General Tipsβ
- Always test your app on both Android and iOS devices to ensure consistent behavior across platforms.
- Use the React Native Debugger and other debugging tools to inspect and troubleshoot event-related issues.
- Keep your dependencies up to date to benefit from the latest bug fixes and improvements.
Common Issues with HTML DOM Events in React Nativeβ
DragEventβ
Issue: Drag and drop functionality not working as expected.
Solution: React Native does not natively support drag and drop events. Use third-party libraries like react-native-drag-sort or react-native-draggable to implement drag and drop functionality. Ensure that the components are properly configured and that the drag events are correctly handled.
BeforeUnloadEventβ
Issue: Handling app state before the user navigates away or closes the app.
Solution: React Native does not support the beforeunload event. Use the AppState API to detect when the app is about to go to the background or is closed. Implement appropriate logic to save the app state or prompt the user.
FocusEvent (blur and focusin)β
Issue: Input fields losing focus unexpectedly or not gaining focus.
Solution: Ensure that the TextInput components have the correct onBlur and onFocus handlers. Verify that the components are not being re-rendered unnecessarily, which can cause them to lose focus. Use KeyboardAvoidingView to manage keyboard interactions.
MouseEvent (dblclick, mouseenter)β
Issue: Mouse events not working on web versions of React Native apps.
Solution: Use the react-native-web library to ensure compatibility with web-specific mouse events. Implement event handlers such as onDoubleClick, onMouseEnter, and onMouseLeave to handle mouse interactions.
DropEventβ
Issue: Drop events not being recognized or handled.
Solution: React Native does not natively support drop events. Use third-party libraries like react-native-drag-sort to implement drop functionality. Ensure that the drop zones are correctly defined and that the drop events are properly handled.
MediaEvent (ended, stalled)β
Issue: Media playback issues such as videos not ending or stalling.
Solution: Use the react-native-video library to handle media playback. Ensure that the onEnd and onStalled event handlers are correctly implemented to manage media playback states.
ToggleEventβ
Issue: Toggle events not working as expected.
Solution: React Native does not have a native toggle event. Use state management to handle toggle functionality. Implement custom toggle components or use libraries like react-native-switch to manage toggle states.
VolumeChangeEventβ
Issue: Volume changes not being detected or handled.
Solution: Use the react-native-sound or react-native-video libraries to manage audio and video playback. Implement the onVolumeChange event handler to detect and handle volume changes.
ErrorEventβ
Issue: Errors not being caught or handled properly.
Solution: Use the ErrorBoundary component to catch JavaScript errors in the component tree. Implement global error handling using console.error and ErrorUtils to capture and log errors. Ensure that network requests and other asynchronous operations have proper error handling.
General Tipsβ
- Test your app on both Android and iOS devices to ensure consistent behavior across platforms.
- Use debugging tools like React Native Debugger to inspect and troubleshoot event-related issues.
- Keep your dependencies up to date to benefit from the latest bug fixes and improvements.
- Refer to the official React Native documentation and community resources for best practices and solutions to common issues.


